﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media.Imaging;

namespace RhythmDetect
{
    public partial class MainWindow : Window
    {
        //控制鼓点播放停止
        Random randomMikuSay = new Random();
        private void beatPlay()
        {
            count = 0;
            mikuCount = 0;
            playSwitch = true;
            lbMiku.Text="播放中~~~~";
            
            stopDetect();
            beatPlayer.Play();
        }
        private void beatStop()
        {
            imgMikuBack.Visibility = Visibility.Hidden;
            playSwitch = false;
            imgMiku.Source = new BitmapImage(new Uri("Images/Miku2/5.png", UriKind.Relative));
            imgMikuBack.Source = new BitmapImage(new Uri("Images/Miku2/5.png", UriKind.Relative));
            string mikuSay="";
            switch (randomMikuSay.Next(1, 6))
            {
                case 1:
                    mikuSay = "休息一下！";break;
                case 2:
                    mikuSay = "我还不累~";break;
                case 3:
                    mikuSay = "音乐好好听~！";break;
                case 4:
                    mikuSay = "哒哒哒哒~";break;
                case 5:
                    mikuSay = "点我还可以继续哦";break;
                default:
                    mikuSay = "点我继续";break;
            }
            lbMiku.Text = mikuSay;
        }

        //停止检测
        private void stopDetect()
        {
            detectSwitch = false;
            lbBeatSpeed.Text = "采样停止，按【F】或【J】重新计数";
            arr.Clear();
            pressNum = -1;
        }
    }
}
